package com.example.support.wechat.boot;

import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

import com.example.support.wechat.general.WechatException;

//@org.springframework.context.annotation.Configuration
//@org.springframework.boot.context.properties.EnableConfigurationProperties(WechatProperties.class)
public class WechatAutoConfiguration {

//	public WechatAutoConfiguration(WechatProperties properties) {
//		properties.getMappings().values().forEach(wechat -> {
//			try (InputStream input = wechat.getPay().getCert().getInputStream()) {
//				byte[] certData = IOUtils.toByteArray(input);
//				wechat.getPay().setCertData(certData);
//			} catch (IOException e) {
//				throw new WechatException("初始化微信支付证书失败", e);
//			}
//		});
//	}

}
